import { ApiProperty } from '@nestjs/swagger';
import { LogAppender, LogLevel } from '../../../constants/log.constant';

class GetSystemLogAdminResDtoData {
  @ApiProperty({ description: '日志id' })
  readonly id: number;

  @ApiProperty({ description: '日志级别', enum: LogLevel })
  readonly level: LogLevel;

  @ApiProperty({ description: '日志类别', enum: LogAppender })
  readonly appender: LogAppender;

  @ApiProperty({ description: '内容' })
  readonly message: string;

  @ApiProperty({ description: '详细信息' })
  readonly detail: string;

  @ApiProperty({ description: '创建时间' })
  readonly created_at: Date;
}

export class GetSystemLogAdminResDto {
  @ApiProperty({ description: '总条数' })
  readonly total_count: number;

  @ApiProperty({ description: '日志列表', type: GetSystemLogAdminResDtoData, isArray: true })
  readonly data: GetSystemLogAdminResDtoData[];
}
